How to use dxl to query objs and display the query results in new module?

Deal all,

I am currently learning how to query objects(include object context and attributes) in modules and display the query results in a new created module, do you have any idea or example can help achieve this goal?

ex, I have 2 modules, each has 3 objects. I want to query object text with "item2"/"item4" and print out the resulting modules names which content the object in a new created module.

module1:
1.1 content for module1
item1
item2
item3

module2:
1.1 content for module2
item2
item3
item4

desire output module for search "item2"/"item4":
1.1 Modules name item2 item4
module1 yes no
module2 yse yes

thanks for your help.
SystemAdmin - Mon Oct 03 06:50:18 EDT 2011

Re: How to use dxl to query objs and display the query results in new module?
Lion29 - Mon Oct 03 13:21:17 EDT 2011

Hi,
You can perform a filter on both the modules and validate based on the results.

Module m = read("<< Module1 Path >>")
Module p = read("<< Module2 Path >>")
Filter f1 = contains(attribute "<<Attribute Name>>", "<<Text to search>>", false)

//initialization
int acc = 0
int rej = 0
int acc1 = 0
int rej1 = 0

//perform filter over Module 1
set(m, f1, acc, rej)
print acc
print rej

//perform filter over Module 2
set(p, f1, acc1, rej1)
print acc1
print rej1